package project.gc.com.myapplication;

import android.app.Activity;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;


public class MainActivity extends Activity {

    private ListView listView;
    private TestAdapter adapter;
    private List<String> list;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        DisplayMetrics display = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(display);
        setContentView(R.layout.activity_angle_view);
        listView = findViewById(R.id.lv_test);

        initData();
    }

    private void initData() {
        adapter = new TestAdapter(this);
        listView.setAdapter(adapter);
        list = new ArrayList<>();
        for (int i = 0; i < 150; i++) {
            list.add("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1536061025088&di=09294e4af5964908ae6fee3b8a300ea2&imgtype=0&src=http%3A%2F%2Fe.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2F8c1001e93901213f5480ffe659e736d12f2e955d.jpg");
        }
        adapter.setList(list);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }
}


